package com.richinfo.client.controller;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* Created by WangXJ
* 2018-11-07 11:26
*/
@RefreshScope
@RestController
public class TestController {

	@Value("${from}")
	private String from;
	
	@Resource
	private Environment env;
	
	@GetMapping("/from")
	public String from() {
		return from;
	}
	
	@GetMapping("/env")
	public String env() {
		return env.getProperty("from", "undefined");
	}
}
